//
//  RCHttpResponseSerialization.h
//  RCNetRequestProject
//
//  Created by kabu on 2017/7/18.
//  Copyright © 2017年 RC. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol RCURLResponseSerialization <NSObject, NSSecureCoding, NSCopying>
- (id)responseObjectForResponseSerialization:(NSURLResponse*)response data:(NSData*)data error:(NSError * __autoreleasing *)error;
@end
@interface RCHttpResponseSerialization : NSObject<RCURLResponseSerialization>
@property (strong, nonatomic) NSSet *acceptableContentTypes;
@property (nonatomic, assign) NSStringEncoding stringEncoding;

+ (instancetype)serializer;

@property (nonatomic, copy) NSIndexSet *acceptableStatusCodes;

- (BOOL)validateResponse:(NSHTTPURLResponse *)response data:(NSData *)data error:(NSError * __autoreleasing *)error;
@end

@interface RCJSONResponseSerialization : RCHttpResponseSerialization

- (instancetype  )init;


@property (nonatomic, assign) NSJSONReadingOptions readingOptions;

@property (nonatomic, assign) BOOL removesKeysWithNullValues;


+ (instancetype )serializerWithReadingOptions:(NSJSONReadingOptions)readingOptions;

@end
